package com.kingwang.training.designpattern.builder.builder;

import com.kingwang.training.designpattern.builder.bean.CarBody;
import com.kingwang.training.designpattern.builder.bean.CustomCar;
import com.kingwang.training.designpattern.builder.bean.Engine;
import com.kingwang.training.designpattern.builder.bean.Wheel;

public abstract class CarBuilder {
    protected abstract Engine buildEngine();

    protected abstract CarBody buildBody();

    protected abstract Wheel buildWheel();

    public CustomCar build() {
        CustomCar result = new CustomCar();

        result.setEngine(buildEngine());
        result.setBody(buildBody());

        return result;
    }
}
